package com.itheima.wms.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.base.entity.Entity;
import com.itheima.pinda.base.entity.SuperEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.EQUAL;
import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 盘点清单
 * </p>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@TableName("wms_check_list")
@ApiModel(value = "CheckList", description = "盘点清单")
public class CheckListEntity extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 主记录id
     */
    @ApiModelProperty(value = "主记录id")
    @NotNull(message = "主记录id不能为空", groups = {Save.class})
    @TableField(value = "master_id")
    private Long masterId;
    /**
     * 库存
     */
    @ApiModelProperty(value = "库存")
    @TableField(value = "stock_id")
    private Long stockId;
    /**
     * 库存数量
     */
    @ApiModelProperty(value = "库存数量")
    @TableField(value = "stock_num")
    private Integer stockNum;
    /**
     * 盘点数量
     */
    @ApiModelProperty(value = "盘点数量")
    @TableField(value = "check_num")
    private Integer checkNum;
    /**
     * 数量差异
     */
    @ApiModelProperty(value = "数量差异")
    @TableField(value = "difference_num")
    private Integer differenceNum;
    /**
     * 状态
     */
    @ApiModelProperty(value = "状态 1 一盘，2 复盘")
    @TableField(value = "status")
    private Integer status;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255, message = "备注长度不能超过255")
    @TableField(value = "remark")
    private String remark;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Length(max = 50, message = "创建人长度不能超过50")
    @TableField(value = "create_name", fill = FieldFill.INSERT)
    private String createName;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @Length(max = 50, message = "更新人长度不能超过50")
    @TableField(value = "update_name", fill = FieldFill.INSERT_UPDATE)
    private String updateName;
    /**
     * 逻辑删除 0 删除
     */
    @ApiModelProperty(value = "逻辑删除 0 删除")
    @TableField(value = "logic_del")
    private Integer logicDel;
}
